﻿<UserControl x:Class="SEWilson.ScreenSaver.TheArmory.UI.ItemInfoTooltipControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:armory="clr-namespace:SEWilson.ScreenSaver.TheArmory.UI"
    Height="Auto" Width="Auto" MaxWidth="320">
    <UserControl.Resources>
        <armory:StringIsNullOrEmptyVisibilityConverter x:Key="stringVisibilityConverter" />
        <armory:IntegerVisibilityConverter x:Key="integerVisibilityConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="8" />
            <RowDefinition Height="1*" />
            <RowDefinition Height="8" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="8" />
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="8" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Column="1" Grid.Row="1" Height="Auto" VerticalAlignment="Top">
            <TextBlock VerticalAlignment="Top"
                       Foreground="{Binding QualityColor}" 
                       FontSize="16" FontFamily="Arial Narrow" FontWeight="Bold"
                       HorizontalAlignment="Left" 
                       TextWrapping="Wrap"
                       Text="{Binding Name}"/>
            <TextBlock Visibility="{Binding Path=Bonding, Converter={StaticResource integerVisibilityConverter}}"
                       VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="10" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       TextWrapping="Wrap"
                       Text="{Binding BondingDisplayText}"/>
            <Grid HorizontalAlignment="Stretch" Width="Auto">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*" />
                    <ColumnDefinition Width="32" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0"
                           VerticalAlignment="Top"
                           Foreground="White"
                           FontSize="12" FontFamily="Arial Narrow"
                           HorizontalAlignment="Left" 
                           Text="{Binding SlotName}"/>
                <TextBlock Grid.Column="2"
                           VerticalAlignment="Top"
                           Foreground="White"
                           FontSize="12" FontFamily="Arial Narrow"
                           HorizontalAlignment="Right" 
                           Text="{Binding Type}"/>
            </Grid>
            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=RequiredLevel, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="Requires Level "/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding RequiredLevel}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left"
                       Visibility="{Binding Path=Level, Converter={StaticResource integerVisibilityConverter}}"
                       Text=" ("/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Visibility="{Binding Path=Level, Converter={StaticResource integerVisibilityConverter}}"
                       Text="{Binding Level}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Visibility="{Binding Path=Level, Converter={StaticResource integerVisibilityConverter}}"
                       Text=")"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=Armor, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding Armor}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text=" Armor"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=BonusStamina, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="+"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding BonusStamina}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text=" Stamina"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=BonusIntellect, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="+"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding BonusIntellect}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text=" Intellect"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=BonusStrength, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="+"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding BonusStrength}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text=" Strength"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=BonusWisdom, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="+"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding BonusWisdom}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text=" Wisdom"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=BonusAgility, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="+"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding BonusAgility}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text=" Agility"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=BonusSpirit, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="+"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding BonusSpirit}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text=" Spirit"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Visibility="{Binding Path=DurabilityMax, Converter={StaticResource integerVisibilityConverter}}">
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="Durability: "/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Visibility="{Binding Path=DurabilityCurrent, Converter={StaticResource integerVisibilityConverter}}"
                       Text="{Binding DurabilityCurrent}"/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Visibility="{Binding Path=DurabilityCurrent, Converter={StaticResource integerVisibilityConverter}}"
                       Text=" / "/>
                <TextBlock VerticalAlignment="Top"
                       Foreground="White" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       Text="{Binding DurabilityMax}"/>
            </StackPanel>

            <TextBlock Visibility="Collapsed"
                       VerticalAlignment="Top"
                       Foreground="Chartreuse" 
                       FontSize="12" FontFamily="Arial Narrow"
                       HorizontalAlignment="Left" 
                       TextWrapping="Wrap"
                       Text="{Binding Use}"/>
        </StackPanel>
    </Grid>
</UserControl>
